|
| .NET Framework Class Library |
| ConcurrentDictionary<(Of <(TKey, TValue>)>) Constructor (Int32, Int32) |
| ConcurrentDictionary<(Of <(TKey, TValue>)>) Class See Also Send Feedback |
Initializes a new instance of the ConcurrentDictionary<(Of <(TKey, TValue>)>)
class that is empty, has the specified concurrency level and capacity, and uses the default
comparer for the key type.
Namespace:
System.Collections.Concurrent
Assembly:
System.Threading (in System.Threading.dll)
Syntax
| Visual Basic (Declaration) |
|---|
Public Sub New ( _ concurrencyLevel As Integer, _ capacity As Integer _ ) |
| C# |
|---|
public ConcurrentDictionary( int concurrencyLevel, int capacity ) |
Parameters
- concurrencyLevel
- Type: System..::.Int32
The estimated number of threads that will update the ConcurrentDictionary<(Of <(TKey, TValue>)>) concurrently.
- capacity
- Type: System..::.Int32
The initial number of elements that the ConcurrentDictionary<(Of <(TKey, TValue>)>) can contain.
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentOutOfRangeException | concurrencyLevel is less than 1. |
| System..::.ArgumentOutOfRangeException | capacity is less than 0. |